﻿using System;
using System.Web;
using System.Web.Caching;

namespace Uber.WebUI
{
    public class Caching
    {
        public static object Get(string key)
        {
            return HttpContext.Current.Cache.Get(key);
        }

        public static void RegHost(string address, bool value)
        {
            HttpContext.Current.Cache.Remove(address);
            HttpContext.Current.Cache.Add(address, value, null, Cache.NoAbsoluteExpiration,
                                          new TimeSpan(0, 1, 0, 0),
                                          CacheItemPriority.Normal, null);
        }
    }
}